/**
 * 收货地址相关接口 
 */
var request = require('./request.js');
var utils = require('../utils/utils.js');

module.exports = {
  /**
   * 获取当前会员的收货地址信息
   */
  query: function() {
    return request.get('/newretail/api/mall/deliveryAddress/query')
  },
  /**
   * 新增收货地址
   */
  create: function(postData) {
    return request.post('/newretail/api/mall/deliveryAddress/create', postData)
  },
  /**
   * 获取当前会员的默认收货地址
   */
  getDefaultAddress: function() {
    return request.get('/newretail/api/mall/deliveryAddress/getDefaultAddress')
  },
  /**
   * 更新收货地址
   */
  update: function(postData) {
    return request.put('/newretail/api/mall/deliveryAddress/update', postData)
  },
  /**
   * 根据id删除该条收货地址
   */
  removeById: function(id) {
    return request.delete('/newretail/api/mall/deliveryAddress/removeById?id=' + id)
  },
  /**
   * 检查收货地址门店是否能够配送
   */
  checkDelivery: function(postData) {
    return request.post('/newretail/api/mall/deliveryAddress/checkDelivery', postData)
  }
}